package com.brower.project.net

import com.brower.project.bean.UserInfoBean
import com.brower.project.net.bean.BaseResponse
import retrofit2.http.*


/**
 * desc   :
 * date   : 2020/08/04
 * version: 1.0
 */
interface CommonApiService {

    /**
     * 退出登录
     */
    @GET("user/logout/json/")
    suspend fun logout(/*@Query("audio_id") id: String*/): BaseResponse<UserInfoBean>


    @GET("/article/list/{page}/json/")
    suspend fun getHomeList(@Path("page") id: Int): BaseResponse<UserInfoBean>


    /**
     * 登录
     */
    @FormUrlEncoded
    @POST("user/login/")
    suspend fun login(
        @Field("username") username: String,
        @Field("password") password: String
    ): BaseResponse<UserInfoBean>

    /**
     * 注册
     */
    @FormUrlEncoded
    @POST("/user/register")
    suspend fun register(
        @Field("username") username: String,
        @Field("password") password: String,
        @Field("repassword") repassword: String
    ): BaseResponse<UserInfoBean>

}